home *** CD-ROM | disk | FTP | other *** search
/ Chip 2001 May / Chip Mayıs 2001.iso / prog / share / 07 / ASPFusion / data1.cab / Admin_Pages / Admin / act_index.asp < prev    next >
Encoding:
Text File  |  2001-03-25  |  2.7 KB  |  69 lines

  1. <%
  2. on error resume next
  3. dim SecurityBox
  4. if (Request.Form("Login") = "Login") then
  5.     set SecurityBox = Server.CreateObject("AdvFusionBox.FusionBox")
  6.     SecurityBox.Login(Request.Form("Password"))
  7.     if (SecurityBox.IsError = 1) then
  8.         Session("Error") = SecurityBox.ErrorReason
  9.         set SecurityBox = nothing
  10.         Response.Redirect("index.asp?result=0")
  11.     else
  12.         Session("Index") = "Index"
  13.         set Rst = SecurityBox.GetRegVal("", "InstallationPath", "String")
  14.         if (SecurityBox.IsError = 1) then
  15.             Session("Error") = SecurityBox.ErrorReason
  16.             set SecurityBox = nothing
  17.             Response.Redirect("index.asp?result=0")
  18.         end if
  19.         set Result = SecurityBox.ReturnValues("Admin.ini", "Settings", "Installed")
  20.         if (SecurityBox.IsError = 1) then
  21.             Session("Error") = SecurityBox.ErrorReason
  22.             set Rst = nothing
  23.             set SecurityBox = nothing
  24.             Response.Redirect("index.asp?result=0")
  25.         end if
  26.         set File = Server.CreateObject("Scripting.FileSystemObject")
  27.         DspText = ""
  28.         ActText = vbCrLf & "%" & ">"
  29.         JSCodeText = ""
  30.         for each Member in Result
  31.             DspFileName = Rst.Value & "\Admin\dsp_admin_" & Member.Value & ".asp"
  32.             ActFileName = Rst.Value & "\Admin\act_admin_" & Member.Value & ".asp"
  33.             if (File.FileExists(DspFileName) and File.FileExists(ActFileName)) then
  34.                 DspText = DspText & vbCrLf & "<!--- #include file = 'dsp_admin_" & Member.Value & ".asp' --->"
  35.                 ActText = ActText & vbCrLf & "<!--- #include file = 'act_admin_" & Member.Value & ".asp' --->"
  36.                 JSCodeText = JSCodeText & vbCrLf & "if (!admin_" & LCase(Member.Value) & "()) return false;"
  37.             end if
  38.         next
  39.         set File = nothing
  40.         set Result = nothing
  41.         ActText = ActText & vbCrLf & "<" & "%"
  42.         SecurityBox.Insert Rst.Value & "\Admin\dsp_welcome.asp", DspText, "<!--- ASP Include Start Mark --->", "<!--- ASP Include End Mark --->"
  43.         if (SecurityBox.IsError = 1) then
  44.             Session("Error") = SecurityBox.ErrorReason
  45.             set Rst = nothing
  46.             set SecurityBox = nothing
  47.             Response.Redirect("index.asp?result=0")
  48.         end if
  49.         SecurityBox.Insert Rst.Value & "\Admin\act_welcome.asp", ActText, "'ASP Include Start Mark", "'ASP Include End Mark"
  50.         if (SecurityBox.IsError = 1) then
  51.             Session("Error") = SecurityBox.ErrorReason
  52.             set Rst = nothing
  53.             set SecurityBox = nothing
  54.             Response.Redirect("index.asp?result=0")
  55.         end if
  56.         SecurityBox.Insert Rst.Value & "\Admin\index.js", JSCodeText, "/* JS Code Start Mark */", "/* JS Code End Mark */"
  57.         set Rst = nothing
  58.         if (SecurityBox.IsError = 1) then
  59.             Session("Error") = SecurityBox.ErrorReason
  60.             set SecurityBox = nothing
  61.             Response.Redirect("index.asp?result=0")
  62.         end if
  63.         set SecurityBox = nothing
  64.         Response.Redirect("dsp_welcome.asp")
  65.     end if
  66. else
  67.     Response.Redirect("index.asp")
  68. end if
  69. %>